﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace Midgard
{
    class SoundsManager
    {

        SoundEffect fireSound; // The sound that a projectile is fired. 

        SoundEffect explosionSound;  // The sound used when the player or an enemy dies

        Song gameplayMusic; // The music played during gameplay



        // Load the music
        public void loadSounds(Song gameMusic)
        {
            gameplayMusic = gameMusic;//Content.Load<Song>("sound/gameMusic");

            // Load the laser and explosion sound effect
          //  fireSound = Content.Load<SoundEffect>("sound/laserFire");
          //  explosionSound = Content.Load<SoundEffect>("sound/explosion");

            // Start the music right away
            PlayMusic(gameplayMusic);
        }

        private void PlayMusic(Song song)
        {
            try
            {
                // Play the music
                MediaPlayer.Play(song);

                // Loop the currently playing song
                MediaPlayer.IsRepeating = true;
            }
            catch { }
        }
    }
}
